#include "apue.h"
int main(int argc, char **argv) {
	for (int i = 1; i < argc; i++) {
		if (access(argv[i], R_OK) < 0)
			err_ret("access error for %s", argv[i]);
		else
			printf("read access OK\n");
		if (open(argv[i], O_RDONLY) < 0)
			err_ret("open error for %s", argv[i]);
		else
			printf("open for reading OK\n");
	}
	return 0;
}
